/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.stock.db.ec;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author sosa
 */
@Entity
@Table(name = "auditoria_cliente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AuditoriaCliente.findAll", query = "SELECT a FROM AuditoriaCliente a"),
    @NamedQuery(name = "AuditoriaCliente.findById", query = "SELECT a FROM AuditoriaCliente a WHERE a.id = :id"),
    @NamedQuery(name = "AuditoriaCliente.findByTelefonoAnterior", query = "SELECT a FROM AuditoriaCliente a WHERE a.telefonoAnterior = :telefonoAnterior"),
    @NamedQuery(name = "AuditoriaCliente.findByTelefonoPosterior", query = "SELECT a FROM AuditoriaCliente a WHERE a.telefonoPosterior = :telefonoPosterior"),
    @NamedQuery(name = "AuditoriaCliente.findByEmailAnterior", query = "SELECT a FROM AuditoriaCliente a WHERE a.emailAnterior = :emailAnterior"),
    @NamedQuery(name = "AuditoriaCliente.findByEmailPosterior", query = "SELECT a FROM AuditoriaCliente a WHERE a.emailPosterior = :emailPosterior"),
    @NamedQuery(name = "AuditoriaCliente.findByMotivo", query = "SELECT a FROM AuditoriaCliente a WHERE a.motivo = :motivo")})
public class AuditoriaCliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Long id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "telefono_anterior")
    private String telefonoAnterior;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "telefono_posterior")
    private String telefonoPosterior;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "email_anterior")
    private String emailAnterior;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "email_posterior")
    private String emailPosterior;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "motivo")
    private String motivo;
    @JoinColumn(name = "id_cliente", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Cliente idCliente;

    public AuditoriaCliente() {
    }

    public AuditoriaCliente(Long id) {
        this.id = id;
    }

    public AuditoriaCliente(Long id, String telefonoAnterior, String telefonoPosterior, String emailAnterior, String emailPosterior, String motivo) {
        this.id = id;
        this.telefonoAnterior = telefonoAnterior;
        this.telefonoPosterior = telefonoPosterior;
        this.emailAnterior = emailAnterior;
        this.emailPosterior = emailPosterior;
        this.motivo = motivo;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTelefonoAnterior() {
        return telefonoAnterior;
    }

    public void setTelefonoAnterior(String telefonoAnterior) {
        this.telefonoAnterior = telefonoAnterior;
    }

    public String getTelefonoPosterior() {
        return telefonoPosterior;
    }

    public void setTelefonoPosterior(String telefonoPosterior) {
        this.telefonoPosterior = telefonoPosterior;
    }

    public String getEmailAnterior() {
        return emailAnterior;
    }

    public void setEmailAnterior(String emailAnterior) {
        this.emailAnterior = emailAnterior;
    }

    public String getEmailPosterior() {
        return emailPosterior;
    }

    public void setEmailPosterior(String emailPosterior) {
        this.emailPosterior = emailPosterior;
    }

    public String getMotivo() {
        return motivo;
    }

    public void setMotivo(String motivo) {
        this.motivo = motivo;
    }

    public Cliente getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(Cliente idCliente) {
        this.idCliente = idCliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AuditoriaCliente)) {
            return false;
        }
        AuditoriaCliente other = (AuditoriaCliente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.stock.db.ec.AuditoriaCliente[ id=" + id + " ]";
    }
    
}
